import request from '@/utils/request'

// 查询调研答卷名称列表
export function listResearchExam(query) {
  return request({
    url: '/house_sale/ResearchExam/list',
    method: 'get',
    params: query
  })
}

export function projectinfo() {
  return request({
    url: '/house_sale/ResearchExam/projectList/',
    method: 'get'
  })
}

// 查询调研答卷名称详细
export function getResearchExam(reseachid) {
  return request({
    url: '/house_sale/ResearchExam/' + reseachid,
    method: 'get'
  })
}

// 新增调研答卷名称
export function addResearchExam(data) {
  return request({
    url: '/house_sale/ResearchExam',
    method: 'post',
    data: data
  })
}

// 修改调研答卷名称
export function updateResearchExam(data) {
  return request({
    url: '/house_sale/ResearchExam',
    method: 'put',
    data: data
  })
}

// 删除调研答卷名称
export function delResearchExam(reseachid) {
  return request({
    url: '/house_sale/ResearchExam/' + reseachid,
    method: 'delete'
  })
}

//答卷状态修改
export function changeinvalid(reseachid, invalid) {
  const data = {
    reseachid,
    invalid
  }
  return request({
    url: '/house_sale/ResearchExam/changeinvalid',
    method: 'put',
    data: data
  })
}
export function listExamMaster(reseachid) {
  return request({
    url: '/house_sale/ResearchExam/exammaster/'+ reseachid,
    method: 'get'
  })
}
export function listExamResult(examid,custid) {
  const data = {
    examid,
    custid
  }
  return request({
    url: '/house_sale/ResearchExam/examresult',
    method: 'put',
    data: data
  })
}
export function updResult(examid,result){
  const data = {
    examid,
    result
  }
  return request({
    url: '/house_sale/ResearchExam/examMasterResult',
    method: 'put',
    data: data
  })
}
export function  ExamResultList(reseachid,custid){
  const data = {
    reseachid,
    custid
  }
  return request({
    url: '/house_sale/ResearchExam/examResultList',
    method: 'put',
    data: data
  })
}
//导入
export function parsefile(data) {
  return request({
    url: '/house_sale/ResearchExam/exammaster/'+ reseachid,
    method: 'get',
    data: data
  })
}
